
<!DOCTYPE html>
<html>
  <head>
    
<meta charset="utf-8" >

<title>gitee初次使用 | 集邮</title>
<meta name="description" content="集邮不是集邮，可能是某种收藏癖好，收集创客相关">

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css">

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<link rel="shortcut icon" href="https://djzrs.gitee.io/jiyou/favicon.ico?v=1711621826170">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css">
<link rel="stylesheet" href="https://djzrs.gitee.io/jiyou/styles/main.css">



<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.5.1/build/highlight.min.js"></script>



  </head>
  <body>
    <div id="app" class="main">
      <div class="site-header-container">
  <div class="site-header">
    <div class="left">
      <a href="https://djzrs.gitee.io/jiyou">
        <img class="avatar" src="https://djzrs.gitee.io/jiyou/images/avatar.png?v=1711621826170" alt="" width="32px" height="32px">
      </a>
      <a href="https://djzrs.gitee.io/jiyou">
        <h1 class="site-title">集邮</h1>
      </a>
    </div>
    <div class="right">
      <transition name="fade">
        <i class="icon" :class="{ 'icon-close-outline': menuVisible, 'icon-menu-outline': !menuVisible }" @click="menuVisible = !menuVisible"></i>
      </transition>
    </div>
  </div>
</div>

<transition name="fade">
  <div class="menu-container" style="display: none;" v-show="menuVisible">
    <div class="menu-list">
      
        
          <a href="https://djzrs.gitee.io/jiyou" class="menu purple-link">
            首页
          </a>
        
      
        
          <a href="https://djzrs.gitee.io/jiyou/archives" class="menu purple-link">
            归档
          </a>
        
      
        
          <a href="https://djzrs.gitee.io/jiyou/tags" class="menu purple-link">
            标签
          </a>
        
      
        
          <a href="https://djzrs.gitee.io/jiyou/qfwytkg2n" class="menu purple-link">
            关于
          </a>
        
      
    </div>
  </div>
</transition>


      <div class="content-container">
        <div class="post-detail">
          
            <div class="feature-container" style="background-image: url('https://djzrs.gitee.io/jiyou/post-images/9KDiHbMsM.png')">
            </div>
          
          <h2 class="post-title">gitee初次使用</h2>
          <div class="post-info post-detail-info">
            <span><i class="icon-calendar-outline"></i> 2023-11-19</span>
            
              <span>
                <i class="icon-pricetags-outline"></i>
                
                  <a href="https://djzrs.gitee.io/jiyou/QM7AE6C7e/">
                    git
                    
                      ，
                    
                  </a>
                
                  <a href="https://djzrs.gitee.io/jiyou/Ebd-2W3zQ3/">
                    gitee
                    
                  </a>
                
              </span>
            
          </div>
          <div class="post-content" v-pre>
            <p>git安装教程<br>
开始教程<br>
配置ssh公钥<br>
上传<br>
下载</p>
<!-- more -->
<p>请看Gitee官方文档https://gitee.com/help/articles/4122</p>
<h3 id="git安装教程">git安装教程</h3>
<p>下载地址：https://npm.taobao.org/mirrors/git-for-windows/</p>
<p>参考教程：https://gitee.com/niit-cs/computational-thinking#/niit-cs/computational-thinking/blob/master/labs/test/test.md</p>
<h3 id="开始教程">开始教程</h3>
<h4 id="1右键打开git-bash输入如下命令配置git操作的用户名-邮箱">1，右键打开Git Bash，输入如下命令，配置git操作的用户名、邮箱。</h4>
<p><code>$ git config --global user.name &quot;你的名字或昵称&quot;</code></p>
<p><code>$ git config --global user.email &quot;你的邮箱&quot;</code><br>
<img src="https://djzrs.gitee.io/jiyou/post-images/1701605267845.png" alt="" loading="lazy"><br>
<img src="https://djzrs.gitee.io/jiyou/post-images/1701605278873.png" alt="" loading="lazy"><br>
<img src="https://djzrs.gitee.io/jiyou/post-images/1701605290669.png" alt="" loading="lazy"><br>
<img src="https://djzrs.gitee.io/jiyou/post-images/1701605309749.png" alt="" loading="lazy"></p>
<h4 id="2配置ssh公钥">2，配置ssh公钥</h4>
<p>在Git Bash中输入如下命令，生成SSH key。</p>
<p><code>$ ssh-keygen -t rsa -C &quot;你的邮箱&quot;</code></p>
<figure data-type="image" tabindex="1"><img src="https://djzrs.gitee.io/jiyou/post-images/1701605348568.png" alt="生成sshkey.png" loading="lazy"></figure>
<h4 id="3输入如下第1行命令打印刚才生成的ssh-key">3，输入如下第1行命令，打印刚才生成的SSH key</h4>
<p><code>$ cat ~/.ssh/id_rsa.pub</code></p>
<figure data-type="image" tabindex="2"><img src="https://djzrs.gitee.io/jiyou/post-images/1701605372355.png" alt="打印sshkey.png" loading="lazy"></figure>
<h4 id="4主页右上角-个人设置-安全设置-ssh公钥-添加公钥-复制生成的-public-key添加到当前账户中">4，主页右上角 「个人设置」-&gt;「安全设置」-&gt;「SSH公钥」-&gt;「添加公钥」 ，复制生成的 public key，添加到当前账户中。</h4>
<figure data-type="image" tabindex="3"><img src="https://djzrs.gitee.io/jiyou/post-images/1701605398378.png" alt="粘贴sshkey.png" loading="lazy"></figure>
<figure data-type="image" tabindex="4"><img src="https://djzrs.gitee.io/jiyou/post-images/1701605417323.png" alt="添加公钥.png" loading="lazy"></figure>
<h4 id="5测试ssh-key是否配置ok">5，测试SSH key是否配置ok：</h4>
<p><code>$ ssh -T git@gitee.com</code></p>
<p>Hi 朱家乐! You've successfully authenticated, but GITEE.COM does not provide shell access.</p>
<figure data-type="image" tabindex="5"><img src="https://djzrs.gitee.io/jiyou/post-images/1701605441386.png" alt="添加公钥成功.png" loading="lazy"></figure>
<h3 id="上传文件操作">上传文件操作</h3>
<p>注意不要删除</p>
<p><code>$ git add .                          #将当前目录所有文件添加到git暂存区</code></p>
<p><code>$ git commit -m &quot;my commit&quot;          #提交并备注提交信息</code></p>
<p><code>$ git push                           #将本地提交推送到远程仓库</code></p>
<figure data-type="image" tabindex="6"><img src="https://djzrs.gitee.io/jiyou/post-images/1701605466026.png" alt="gitpush.png" loading="lazy"></figure>
<figure data-type="image" tabindex="7"><img src="https://djzrs.gitee.io/jiyou/post-images/1701605485231.png" alt="账号.png" loading="lazy"></figure>
<figure data-type="image" tabindex="8"><img src="https://djzrs.gitee.io/jiyou/post-images/1701605501792.png" alt="push验证.png" loading="lazy"></figure>
<h3 id="下载文件操作">下载文件操作</h3>
<p>打开<mark>自己账号</mark>下的仓库，点击 “克隆/下载” 按钮，选择 “SSH”, 点击“复制”</p>
<p><code>$ git clone git@gitee.com</code></p>
<figure data-type="image" tabindex="9"><img src="https://djzrs.gitee.io/jiyou/post-images/1701605521881.png" alt="克隆仓库.png" loading="lazy"></figure>
<p></p>
<h3 id="备注">备注</h3>
<p><a href="https://blog.csdn.net/Hhhshsjjsns/article/details/133989922">git上传报错 git报错：remote: Access denied 拒绝访问 fatal: unable to access ‘ https:/ /gitee. cohe requested UR-CSDN博客</a></p>

          </div>
        </div>

        
          <div class="next-post">
            <a class="purple-link" href="https://djzrs.gitee.io/jiyou/N3qcaOPfA/">
              <h3 class="post-title">
                下一篇：Markdown语法
              </h3>
            </a>
          </div>
          
      </div>

      

      <div class="site-footer">
  <div class="slogan">集邮不是集邮，可能是某种收藏癖好，收集创客相关</div>
  <div class="social-container">
    
      
        <a href="https://gitee.com/djzrs/jiyou" target="_blank">
          <i class="fab fa-github"></i>
        </a>
      
    
      
        <a href="https://qm.qq.com/q/MAQoNdBsw6" target="_blank">
          <i class="fab fa-twitter"></i>
        </a>
      
    
      
        <a href="https://qm.qq.com/q/MAQoNdBsw6" target="_blank">
          <i class="fab fa-weibo"></i>
        </a>
      
    
      
        <a href="https://qm.qq.com/q/MAQoNdBsw6" target="_blank">
          <i class="fab fa-zhihu"></i>
        </a>
      
    
      
        <a href="https://qm.qq.com/q/MAQoNdBsw6" target="_blank">
          <i class="fab fa-facebook"></i>
        </a>
      
    
  </div>
  Powered by <a href="https://github.com/getgridea/gridea" target="_blank">Gridea</a>
联系我：djzrs@qq.com | <a class="rss" href="https://djzrs.gitee.io/jiyou/atom.xml" target="_blank">RSS</a>
</div>


    </div>
    <script type="application/javascript">

hljs.initHighlightingOnLoad()

var app = new Vue({
  el: '#app',
  data: {
    menuVisible: false,
  },
})

</script>




  </body>
</html>
